home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Developer Essentials / DTS Sample Code / System 7.0 Samples / MacShell / MacShell.make < prev    next >
Encoding:
Text File  |  1991-12-04  |  9.4 KB  |  235 lines  |  [TEXT/MPS ]

  1. #------------------------------------------------------------------------------
  2. #
  3. #    Apple Macintosh Developer Technical Support
  4. #
  5. #    Program:    MacShell
  6. #    File:        MacShell.make    -    Make Source
  7. #
  8. #    Copyright © 1988-1991 Apple Computer, Inc.
  9. #    All rights reserved.
  10. #
  11. #------------------------------------------------------------------------------
  12.  
  13. AppName            =    'MacShell'
  14. Signature        =    'CSHL'
  15.  
  16. #------------------------------------------------------------------------------
  17. # Location of our utility files. The double “:” means “one level above the
  18. # current folder”. Hopefully, this will also be the location of our
  19. # utilities folder. If not, then change the following line:
  20. #------------------------------------------------------------------------------
  21.  
  22. UtilityFolder    =    "::DTS.Utilities:"
  23. src                =    :
  24. obj                =     :OBJECT:
  25.  
  26. #------------------------------------------------------------------------------
  27. # Options for our compilers:
  28. #    -sym on: tells the compilers and linker to emit symbol information for
  29. #        a source level debugger, such as SADE.
  30. #    -i {UtilityFolder}: means to look for any #include files in the specified
  31. #        directory, as well as the normal set.
  32. #    -r: tells the C compiler to require function prototypes.
  33. #    -mbg off: tells the compilers to not emit low-level debugger names. This
  34. #        saves on file space, but you may wish to remove this option if you
  35. #        need to debug with something like Macsbug.
  36. #    -rd: for Rez means to suppress warnings for redeclared types (we redeclare
  37. #        'RECT' because it’s not included in MPW 3.0).
  38. #    -append: means to add the resources to the target file, rather than
  39. #        deleting all the ones that are there first.
  40. #    -d Signature...: is a way of passing our application's signature to Rez.
  41. #        With this mechanism, we can define our signature here, and export
  42. #        it to Rez, so that we don't have to declare it there, too.
  43. #    -sn STDCLIB=Main: puts all the routines that would normally go into the
  44. #        STDCLIB segment into the Main segment. This is done so that when we
  45. #        call upon any low-level utilities, we don't potentially move memory
  46. #        by loading in a segment.
  47. #------------------------------------------------------------------------------
  48.  
  49. SymOptions        =    #-sym on                    # turn this on to debug with SADE
  50. IncludesFolders    =    -i {UtilityFolder}
  51.  
  52. COptions        =    {IncludesFolders} {SymOptions} -r -mbg on
  53. RezOptions        =    {IncludesFolders} -rd -append -d Signature="{Signature}" -d AppName={AppName}
  54. LinkOptions        =    {SymOptions} {SegmentMappings} -msg nodup
  55. SegmentMappings    =    -sn INTENV=Main ∂
  56.                     -sn PASLIB=Main ∂
  57.                     -sn STDCLIB=Main ∂
  58.                     -sn SANELIB=Main ∂
  59.                     -sn UtilMain=Main ∂
  60.                     -sn MAFailureRes=Main ∂
  61.                     -sn Offscreen=Main ∂
  62.                     -sn UtilInit=Initialization
  63.  
  64. #------------------------------------------------------------------------------
  65. # These are modified default build rules.  This is necessary to take into
  66. # account differences between MPW 3.1 and 3.2
  67. #------------------------------------------------------------------------------
  68. {obj}            ƒ    {src}
  69.  
  70. {obj}.p.o        ƒ    {src}.p
  71.     {Pascal} {POptions} {PAltOptions} {DepDir}{Default}.p -o {TargDir}{Default}.p.o
  72.  
  73. {obj}.c.o        ƒ    {src}.c
  74.     {C} {COptions} {CAltOptions} {DepDir}{Default}.c -o {TargDir}{Default}.c.o
  75.  
  76. #------------------------------------------------------------------------------
  77. # These are the objects that we want to link with. If any one of these
  78. # changes, then we invoke the Link command.
  79. #------------------------------------------------------------------------------
  80. AppObjects        =    ∂
  81.                     {UtilityFolder}Utilities.c.o ∂
  82.                     {obj}start.c.o ∂
  83.                     {obj}aeconnect.c.o ∂
  84.                     {obj}aecustom.c.o ∂
  85.                     {obj}aerequired.c.o ∂
  86.                     {obj}aeutils.c.o ∂
  87.                     {obj}appletalk.c.o ∂
  88.                     {obj}ctlhandler.c.o ∂
  89.                     {obj}docursor.c.o ∂
  90.                     {obj}doevent.c.o ∂
  91.                     {obj}eventloop.c.o ∂
  92.                     {obj}file.c.o ∂
  93.                     {obj}file2.c.o ∂
  94.                     {obj}help.c.o ∂
  95.                     {obj}idletasks.c.o ∂
  96.                     {obj}init.c.o ∂
  97.                     {obj}listcontrol.c.o ∂
  98.                     {obj}menu.c.o ∂
  99.                     {obj}print.c.o ∂
  100.                     {obj}texteditcontrol.a.o ∂
  101.                     {obj}texteditcontrol.c.o ∂
  102.                     {obj}utils.c.o ∂
  103.                     {obj}window.c.o ∂
  104.                     {obj}window2.c.o
  105.  
  106. #------------------------------------------------------------------------------
  107. # These help define the libraries that we want to link with. {AppObjects} holds
  108. # the names of the application units we want to link together. {CLibs} holds
  109. # the libraries we want to link with under MPW 3.0 or MPW 3.1. Under MPW 3.2
  110. # and later, “CInterface.o” and “CRuntime.o” are merged with “Interface.o” and
  111. # “Runtime.o”. So, under 3.2 and later, we link with the files in {CLibs32}
  112. # instead.
  113. #------------------------------------------------------------------------------
  114. PLibs            =    ∂
  115.                     "{Libraries}Runtime.o" ∂
  116.                     {UtilityFolder}GestaltGlue.a.o ∂
  117.                     "{Libraries}Interface.o" ∂
  118.                     "{PLibraries}PasLib.o"
  119.  
  120. PLibs32            =    ∂
  121.                     "{Libraries}Runtime.o" ∂
  122.                     "{Libraries}Interface.o" ∂
  123.                     "{PLibraries}PasLib.o"
  124.  
  125. CLibs            =    ∂
  126.                     "{CLibraries}CRuntime.o" ∂
  127.                     "{CLibraries}CInterface.o" ∂
  128.                     {UtilityFolder}GestaltGlue.a.o ∂
  129. #                    "{CLibraries}StdCLib.o" ∂
  130.                     "{Libraries}Interface.o"
  131.  
  132. CLibs32            =    ∂
  133.                     "{Libraries}Runtime.o" ∂
  134. #                    "{CLibraries}StdCLib.o" ∂
  135.                     "{Libraries}Interface.o"
  136.  
  137. #------------------------------------------------------------------------------
  138. # Generic Utilities dependencies - This standard set is pasted in whenever
  139. # we make use of the Utilities routines. It's quite probable that we don't
  140. # need all of these dependencies for this build, but any extra ones are
  141. # ignored.
  142. #------------------------------------------------------------------------------
  143.  
  144. UtilityRezFiles            =    {UtilityFolder}Utilities.r ∂
  145.                             {UtilityFolder}UtilitiesCommon.h
  146.                         
  147. UtilityHeaderFiles        =    {UtilityFolder}Utilities.h ∂
  148.                             {UtilityFolder}UtilitiesCommon.h
  149.  
  150. UtilityInterfaceFiles    =    {UtilityFolder}Utilities.p
  151.  
  152. {UtilityFolder}Utilities.p.o    ƒ    {UtilityFolder}Utilities.inc1.p
  153.  
  154. {UtilityFolder}Utilities.c.o    ƒ    {UtilityFolder}Utilities.h ∂
  155.                                     {UtilityFolder}UtilitiesCommon.h
  156.  
  157. #------------------------------------------------------------------------------
  158. # Dependencies for the individual components. These will invoke the
  159. # default build rules listed in Chapter 9 of the MPW 3.0 manual.
  160. # You may wish to reduce the number of dependencies.  Two dependencies
  161. # you may wish to remove are this makefile and the MacShell.protos file.
  162. # For the MacShell.protos file, if you add a function to the list of
  163. # functions in MacShell.protos, you will cause all the source files to be
  164. # recompiled.  This may be more than you want to wait for each time you
  165. # add a function to your application.  On the other hand, if you do not
  166. # include this in the dependencies, and you change the parameters for a
  167. # function, and make the respective change to MacShell.protos, any files
  168. # that reference that function will not be recompiled.  If these files are
  169. # recompiled, the prototype checking will catch any cases where you did
  170. # not change the way the altered function was called.  <<You choose>>
  171. #------------------------------------------------------------------------------
  172.  
  173. {AppObjects}    ƒ    #{AppName}.make ∂
  174. #                    MacShell.h ∂
  175. #                    MacShell.protos ∂
  176.                     MacShellVersion.h ∂
  177.                     {UtilityFolder}Utilities.c ∂
  178.                     {UtilityHeaderFiles}
  179.  
  180. #------------------------------------------------------------------------------
  181. # This is a dummy dependency rule.  This will always be executed.  This dummy
  182. # rule must be the first for {AppName} so that it will be executed first.
  183. # This is necessary to make evaluations that are beyond the scope of
  184. # Make.  These evaluations will be performed by the MacShell at execution time,
  185. # and they must execute first because compile and link command lines depend
  186. # on variables set up by these evaluations.  This has the unfortunate side
  187. # effect that Make will always consider {AppName} to be out of date.  It will
  188. # always, at a minimum, execute the commands for the target ShellForce.
  189. #------------------------------------------------------------------------------
  190.  
  191. {AppName}            ƒƒ ShellForce
  192.  
  193. # With the above rule, {AppName} will always be out of date with respect to
  194. # the non-existent file ShellForce.  This will force the following commands to
  195. # be executed.
  196. ShellForce            ƒ
  197.     BEGIN
  198.         IF "{ShellVersion}" == ""
  199.             ( EVALUATE "`Version`" =~ /MPW Shell≈ ([0-9]+(.[ab0-9]+)+)®1≈/ ) ∑ Dev:Null
  200.             SET ShellVersion "{®1}"
  201.         END
  202.         IF "{ShellVersion}" =~ /3.[01]≈/
  203.             SET PAltOptions "-d MPW32=FALSE"
  204.             SET CAltOptions "-d MPW31"
  205.             SET PSysObjects "`QUOTE {PLibs}`"
  206.             SET CSysObjects "`QUOTE {CLibs}`"
  207.         ELSE
  208.             SET PAltOptions "-d MPW32=TRUE"
  209.             SET CAltOptions "-d MPW32"
  210.             SET PSysObjects "`QUOTE {PLibs32}`"
  211.             SET CSysObjects "`QUOTE {CLibs32}`"
  212.         END
  213.     END ∑ Dev:Null # Output to bit bucket so we don’t see above calculations
  214.  
  215. #------------------------------------------------------------------------------
  216. # Build rule that links our application together. If any of our objects 
  217. # changes, or this makefile changes, then we relink.  The dummy prerequisite
  218. # ShellForce must come before any other prerequisites for {AppName}
  219. #------------------------------------------------------------------------------
  220.  
  221. {AppName}            ƒƒ {AppObjects}
  222.     Link {LinkOptions} -o {Targ} {AppObjects} {CSysObjects}
  223.     SetFile {Targ} -t APPL -c {Signature} -a B
  224.  
  225. #------------------------------------------------------------------------------
  226. # Build rule that creates our resources and adds them to the application
  227. #------------------------------------------------------------------------------
  228.  
  229. {AppName}        ƒƒ    {AppName}.make ∂
  230.                     MacShell.r ∂
  231.                     MacShellCommon.h ∂
  232.                     MacShellVersion.h ∂
  233.                     {UtilityRezFiles}
  234.     Rez {RezOptions} MacShell.r -o {Targ}
  235.